home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Linux Cubed Series 8: LINUX Games
/
Linux Cubed Series 8 - LINUX Games.iso
/
games
/
video
/
zapem-0.000
/
zapem-0
/
zapem
/
alopen.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-03-30
|
534b
|
31 lines
/* Copyright Alex Hornby 1994/1995. All rights reserved.
See file README for details
*/
/* AL's fopen. open with a fallback! */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
FILE*
alopen( char *name, char *mode)
{
char name1[256], name2[256];
FILE *fp;
strcpy(name1,"./");
strcpy(name2,LIBDIR);
strcat(name1,name);
strcat(name2,name);
fp=fopen(name1,mode);
if(fp==0)
{
fp=fopen(name2,mode);
if(fp==0)
{
fprintf(stderr,"Files %s and %s not found.\n",name1, name2);
exit(1);
}
}
return fp;
}